<template>
  <script :id="id" type="text/plain">
    { { content } }
  </script>
</template>

<script>
export default {
  name: 'UE',
  props: {
    config: {
      type: Object
    },
    id: {
      type: String
    },
    content: {
      type: String
    }
  },
  data() {
    return {
      editor: null
    }
  },
  mounted() {
    this._initEditor()
  },
  destroyed() {
    this.editor.destroy()
  },
  methods: {
    _initEditor() { // 初始化UE
      this.editor = UE.getEditor(this.id, this.config)
    },
    getUEContent() { // 获取含标签内容方法
      return this.editor.getContent()
    }
  }
}
</script>

<style scoped>

</style>
